package hhh.app.data.bean;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by hhh on 2016/10/25.
 */
public class Product implements Parcelable {
    private int id;
    private String name;
    private String image;
    private double price;
    private double special;
    private double rating;

    public Product(){}

    public Product(int id, String name, String image, double price, double special, double rating) {
        this.id = id;
        this.name = name;
        this.image = image;
        this.price = price;
        this.special = special;
        this.rating = rating;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(float price) {
        this.price = price;
    }

    public double getSpecial() {
        return special;
    }

    public void setSpecial(float special) {
        this.special = special;
    }

    public double getRating() {
        return rating;
    }

    public void setRating(float rating) {
        this.rating = rating;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeInt(id);
        parcel.writeString(name);
        parcel.writeString(image);
        parcel.writeDouble(price);
        parcel.writeDouble(special);
        parcel.writeDouble(rating);
    }

    public static final Parcelable.Creator<Product> CREATOR=new Parcelable.Creator<Product>(){
        @Override
        public Product createFromParcel(Parcel parcel) {
            return new Product(parcel.readInt(),parcel.readString(),parcel.readString(),parcel.readDouble(),parcel.readDouble(),parcel.readDouble());
        }

        @Override
        public Product[] newArray(int i) {
            return new Product[i];
        }
    };
}
